home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpw.zip / TPW.QA < prev   
Text File  |  1991-04-18  |  10KB  |  358 lines

  1. QNA-4/8/91
  2. Turbo Pascal for Windows
  3. 1.0
  4. Local Heap and Global Heap
  5. TPW's New, GetMem, Dispose and Freemem all use Window's global heap.
  6.  
  7. [[[]]]
  8.  
  9. The Local Heap is very small, and not used by TPW, and is occasionally used
  10. by Windows functions (like edit controls).
  11.  
  12. The Global Heap is generally very big, and is where your pascal program's
  13. "heap" is stored.  The GetMem, FreeMem, New, and Dispose procedures all
  14. operate on the Global Heap.
  15.  
  16. <<<>>>
  17. QNA-4/8/91
  18. Turbo Pascal for Windows
  19. 1.0
  20. Exec from within a TPW program.
  21. Use WinExec in the WinDOS to launch DOS and WinApp programs.
  22.  
  23. [[[]]]
  24. Question:
  25.    I want to be able to EXEC a DOS or Windows program in Windows. How do I
  26.   do that?
  27. Answer:
  28.    Take a look at the WinExec procedure in your Windows Reference Guide.
  29.   You can use Exec on both WinApps and DOSApps.
  30.  
  31.  
  32. <<<>>>
  33. QNA-4/8/91
  34. Turbo Pascal for Windows
  35. 1.0
  36. TPW New and GetMem procedures
  37. New, GetMem, HeapBlock, HeapLimit in TPW
  38.  
  39. [[[]]]
  40. The way memory allocation works for new and getmem is as follows:
  41.  
  42. There are two system variables:  HeapBlock and HeapLimit.
  43.  
  44. When memory is allocated for a size less than HeapBlock (Default is 1k)
  45. then the memory will be suballocated in a block of size HeapBlock
  46. (default is 8k).
  47. Allocation of blocks larger than HeapLimit will have there own block.  All
  48. allocations will be in global memory.
  49.  
  50. You will not be able to change the way this works.
  51.  
  52.  
  53. <<<>>>
  54. QNA-4/8/91
  55. Turbo Pascal Windows
  56. 1.0
  57. WinCrt and Windows 3.0
  58. WinCrt cannot be used with OWL.
  59.  
  60. [[[]]]
  61.  
  62.  WinCrt is an emulation of the Dos and Crt units.  Basically, it provides a
  63. quick and dirty means of output to a Windows window.  It's not intended
  64. to be a Dos to Windows porting service - WinCrt apps are not full Windows
  65. apps - just a Windows window with some text, key scanning loops, and
  66. scrollbars.
  67.  
  68.   Note that writelns to the 'screen' will cause a runtime error in TPW
  69. unless the WinCrt unit is used. (WinCrt opens the standard Input and
  70. Output files, which are closed by default in TPW).  The Readln, Keypressed,
  71. procedures, etc., are also only valid under the WinCrt umbrella. The text
  72. colors and text inverse are not supported.  And since WinCrt takes control of
  73. the message loop and dispatch services of your windows app, WinCrt cannot be
  74. used in conjunction with OWL. You can call Windows API functions directly,
  75. however.
  76.  
  77.  
  78. <<<>>>
  79. QNA-4/8/91
  80. Turbo Pascal Windows
  81. 1.0
  82. PChars in TPW.
  83. What is a PChar type?
  84.  
  85. [[[]]]
  86.  
  87.   PChar is a special pointer type that has been added to the Pascal
  88. Windows language definition.  A PChar is a pointer to an array of
  89. characters with a maximum size of 64K and terminated by a null character
  90. (#0).  This is a C string, and comes with all the memory management hassles
  91. and pointer arithmetic advantages of C. The PChars and arrays of char are
  92. type compatible, and a Strings unit is devoted to C-string manipulation
  93. functions (all start with "STR").  When passing a string literal to a
  94. procedure, the compiler will figure out whether the string literal
  95. should be stored in c-string format or in pascal string format, or both.
  96.  
  97.  
  98. <<<>>>
  99. QNA-4/8/91
  100. Turbo Pascal for Windows
  101. 1.0
  102. TDW popping in dual mode in TPW.
  103. How to make TDW come up in dual mode from within TPW.
  104.  
  105. [[[]]]
  106. Question:
  107.  I want to make TDW come up in dual mode from within the TPW.
  108. Answer:
  109.   Add the following lines to the tpw.ini file:
  110.  
  111.   [Debugger]
  112.   Exepath=<pathname>
  113.   Switches=<command-line options>
  114.  
  115.   where <pathname> is the path to the TDW.EXE and <command-line options>
  116.   are the options you normally want to use with TDW, this will do it.  The
  117.   command-line option for the dual display is -do.
  118.  
  119.  
  120. <<<>>>
  121. QNA-4/8/91
  122. Turbo Pascal for Windows
  123. 1.0
  124. Changing Button Text
  125. Use SetCaption method in OWL or SendMessage API to change button text.
  126.  
  127. [[[]]]
  128. Question:
  129. How do you change the text on a button?
  130.  
  131. Answer:
  132. To change the text on a button, send a WM_SETTEXT message with the string for
  133. the lParam.  For example:
  134.  
  135.   SendMessage(btnWindow, WM_SETTEXT, 0, 'New Button Title');
  136.  
  137. Or if you are using OWL, call the SetCaption method of TButton.
  138.  
  139.  
  140. <<<>>>
  141. QNA-4/8/91
  142. Turbo Pascal for Windows
  143. 1.0
  144. Status line in a MDI Application.
  145. How can I have a status line in an MDI Application?
  146.  
  147. [[[]]]
  148.  
  149. To have a status line in an MDI application, override the windows MDI
  150. WMSize method like this:
  151.  
  152.   TGDIDemoWindow.WMSize(var Message: TMessage);
  153.   begin
  154.     TMDIWindow.WMSize(Message);
  155.     {Calculate the new size of the client area}
  156.     MoveWindow(ClientWnd^.HWindow, size of the new client area)
  157.   end;
  158.  
  159. This will keep the client window from obscuring your status line or other
  160. controls you might like to have in your window.
  161.  
  162.  
  163. <<<>>>
  164. QNA-4/8/91
  165. Turbo Pascal for Windows
  166. 1.0
  167. TPW  1.0 Hot Sheet.
  168. Feature set of TPW 1.0.
  169.  
  170. [[[]]]
  171. Turbo Pascal for Windows 1.0 Hot Sheet.
  172.  
  173. Feature Highlights
  174. ----------------------
  175. NEW! state-of-the-art Windows integrated development environment
  176. (IDE).
  177.  
  178.     Runs under Windows
  179.     Multiple editor windows
  180.     Full Mouse Support
  181.     Supports TP6 type hot keys
  182.     Multi-file editor that can edit files up to 1MB
  183.     complete save and restore of desktop
  184.  
  185. NEW! ObjectWindow library - Built in support for Windows, Menus,
  186. Dialogs, Buttons, List boxes, Edit fields, Icons and more.  All
  187. for use in your applications.
  188.  
  189. NEW! Full access to all Windows API functions and messages.
  190.  
  191. NEW! Fully Supports creation of DLLs.
  192.  
  193. NEW! Turbo Debugger for Windows
  194.  
  195.     Supports Windows messages
  196.     Advanced breakpoints
  197.     Reverse execution
  198.     Automatic DLL debugging
  199.     Object browser and inspectors
  200.     Single and dual monitor support
  201.  
  202. INCLUDED! Whitewater Resource Toolkit - Visually create Dialogs,
  203. Menus, Icons, Bitmaps and String resources.
  204.  
  205. INCLUDED! Resource Compiler
  206.  
  207. INCLUDED! Windows Help Compiler
  208.  
  209. Full featured inline assembler (BASM)
  210.  
  211. Private fields and methods in object declarations
  212.  
  213. Extended syntax directive ($X) that lets you treat functions like
  214. procedures (and ignore function results)
  215.  
  216. 286 code generation
  217.  
  218. Address references in typed constants
  219.  
  220. Far and near procedures directives ($F)
  221.  
  222. Link in initialized data ($L) from object (OBJ) files
  223.  
  224. Smart linker removes unused objects and code
  225.  
  226. complete math coprocessor emulation and support -
  227. 8087/80287/80387
  228.  
  229. NEW! Turbo Help hypertext on-line help facilities, including
  230. references to all Windows API finctions and messages.
  231.  
  232. Turbo Pascal for Windows includes everything you need to create
  233. Windows applications.  It does not require the Microsoft Windows
  234. SDK.
  235.  
  236. System Requirements
  237. ---------------------
  238. IBM PC or PS/2 and all 100% compatibles
  239. Microsoft Windows 3.0 or later
  240. 2Mb of memory
  241. EGA, Hercules or VGA graphics
  242. Mouse or other pointing device
  243. Hard Disk (Requires 6.5 Meg for full product)
  244.  
  245. Benchmarks
  246. -----------
  247. Machine                Lines/Min
  248. Compaq DeskPro 386/33    84,000
  249.  
  250. Documentation
  251. ----------------
  252. 1. User's Guide
  253. 2. Programmer's Guide
  254. 3. Windows Reference Guide
  255. 4. Windows Programming Guide
  256. 5. Whitwater Resource Toolkit Users Guide
  257. 6. Turbo Debugger for Windows Users Guide
  258. 7. Help Compiler Reference Guide
  259.  
  260. Pricing Information
  261. -------------------------
  262. Turbo Pascal for Windows   $249.95
  263.  
  264.  
  265. Special Offer Information
  266. ---------------------------
  267. Registered user of ANY BORLAND LANGUAGE PRODUCT $99.95 ***
  268.  
  269.  
  270. ***Turbo Pascal for Windows is exclusively for Windows
  271. Development and does not replace Turbo Pascal version 6.0.  TP6
  272. is the current product for standard DOS development.  The offer
  273. is not an upgrade it is a limited special offer to our current
  274. Turbo Pascal Customers.
  275.  
  276. <<<>>>
  277. QNA-4/8/91
  278. Turbo Pascal for Windows
  279. 1.0
  280. The $G+ directive, 286 code generation, and Real Mode.
  281. How can I detect if Windows is in Real mode?
  282.  
  283. [[[]]]
  284. Question:
  285.  
  286. If I use the $G+ 286 code generation directive, how can I be sure that
  287. Windows is running in Real mode?
  288.  
  289. Answer:
  290.   The 286 code generation option allows the compiler to substitute more
  291. efficient 286 instructions in place of normal 8088 instructions for things
  292. like loops, jumps and memory operations.  If you compile your program with
  293. $G+, then you should call GetWinFlags early in the startup of your
  294. application - such as in your Application.Init.  Check for the wf_PtMode
  295. flag set.  If it's not set, then you're not running in protected mode, and
  296. you should display a message box and exit your program.  Setting the
  297. Application's status variable to a non-zero value should also work, although
  298. that would cause more code to be executed, implying greater risk of hitting a
  299. 286 instruction.
  300.  
  301.   All the precompiled units in TPW will run in real mode and are not
  302. affected by the $G+ directive.  The $G+ directive only affects code that you
  303. compile yourself.
  304.  
  305. <<<>>>
  306. QNA-4/8/91
  307. Turbo Pascal for Windows
  308. 1.0
  309. Using the 80X87 emulator in TPW.
  310. Do I need a coprocessor to run TPW?
  311.  
  312. [[[]]]
  313. Question:
  314.  Must TPW a the math coprocessor?
  315.  
  316. Answer:
  317.   Windows implements its own 80x87 instruction emulator as a DLL that is
  318. loaded when an 80x87 instruction is detected.  The reason that the '87 code
  319. generation is an option is speed:  emulators are always slower than the
  320. real hardware, and slower than using the 6 byte reals.  If you need double,
  321. or  extended reals, or Comp integers, then you must turn on '87
  322. code generation, and Windows will adjust itself to compensate if there
  323. is no '87 hardware when the program is running.  You do not need a
  324. coprocessor to compile or run the program.
  325.  
  326. <<<>>>
  327.  
  328. TN-4/8/91
  329. Turbo Pascal for Windows
  330. 1.0
  331. TPW "Can't find Debugger" error message
  332. "Can't find Debugger" error message can be caused by not enough memory
  333. available.
  334. [[[]]]
  335. With Turbo Pascal for Windows you can get the Can't Find Debugger error
  336. message when there is not enough memory to load the debugger.  There
  337. must be at lease 250K free in order to load the debugger.
  338.  
  339. If you have checked that TDW is in the path etc., and this error is still
  340. displayed,  check the memory free...
  341.  
  342.  
  343. <<<>>>
  344. TN-4/8/91
  345. Turbo Pascal for Windows
  346. 1.0
  347. TPW Strings literals in the Data Segment
  348. TPW String literals are stored in the Data Segment.
  349.  
  350. [[[]]]
  351. Unlike the DOS version of Pascal, String Literals are stored in the data
  352. segment along with all global variables etc.  If customer is running out
  353. of data segment space, suggest using pointers to strings instead of
  354. string literals.
  355.  
  356.  
  357. <<<>>>
  358.